package com.foxmail.aroundme.youtubedemo.listview;

import android.app.Activity;
import android.os.Bundle;
import android.widget.ListView;

import com.foxmail.aroundme.youtubedemo.R;
import com.foxmail.aroundme.youtubedemo.utils.RandomId;

import java.util.ArrayList;
import java.util.List;
import java.util.Random;

/**
 * Created by gzl on 2016/10/26.
 */

public class ListViewAty extends Activity{
    List<String> list = new ArrayList<String>();

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.listviewdemo);
        Random random = new Random();
        for(int i = 0 ; i < 100; i ++){
            list.add(RandomId.args[random.nextInt(100)]);
        }
        ListView listView = (ListView) findViewById(R.id.listview);
        listView.setAdapter(new ListViewAdapter(ListViewAty.this, list, getFragmentManager()));
    }
}
